﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Sio.Mdm.Server.ServerCommands
{
    class Ping : Administration.ServerCommand
    {
        public Ping()
            : base("ping")
        {
        }

        public override string Description
        {
            get
            {
                return "Ping server at specified address and port";
            }
        }

        public override bool AuthorizationRequired
        {
            get
            {
                return false;
            }
        }

        public override bool Execute()
        {
            string address = String.Format("{0}:{1}", Parameters[0], Parameters[1]);
            
            try
            {
                //TODO: Create remote server connection
            }
            catch (Exception)
            {
                Result = String.Format("No server at {0}", address);
            }

            return true;
        }
    }
}
